Skip to main content

App Global Event

Description:

  The global signal slot (event system) communication features. This is just a demonstration record showing the global signal slot names and callbacks.

Usage:

-- Register for these events using codes:
local node = Node():addTo(Director.entry)
node:gslot("AppEvent", function(eventType: string)
print("App event triggered: " .. eventType)
end)

AppEvent

Type: Global Event.

Description:

  Triggers when the application receives an event. The event type could be "Quit", "LowMemory", "WillEnterBackground", "DidEnterBackground", "WillEnterForeground", "DidEnterForeground".

Signature:

["AppEvent"]: function(eventType: string)

AppLowMemory

Type: Global Event.

Description:

  Triggers when the application receives a low memory warning.

Signature:

["AppLowMemory"]: function()

AppWillEnterBackground

Type: Global Event.

Description:

  Triggers when the application is about to enter the background.

Signature:

["AppWillEnterBackground"]: function()

AppDidEnterBackground

Type: Global Event.

Description:

  Triggers when the application has entered the background.

Signature:

["AppDidEnterBackground"]: function()

AppWillEnterForeground

Type: Global Event.

Description:

  Triggers when the application is about to enter the foreground.

Signature:

["AppWillEnterForeground"]: function()

AppDidEnterForeground

Type: Global Event.

Description:

  Triggers when the application has entered the foreground.

Signature:

["AppDidEnterForeground"]: function()

AppChange

Type: Global Event.

Description:

  Triggers when the application settings change. The setting name could be "Locale", "Theme", "FullScreen", "Position", "Size".

Signature:

["AppChange"]: function(settingName: string)

AppWS

Type: Global Event.

Description:

  Triggers when a websocket connection gets an event. The event type could be "Open", "Close", "Send", "Receive".

Signature:

["AppWS"]: function(eventType: string, msg: string)